#define CHECK_PTR_NULL(ptr) do{if ((ptr) == NULL) {ERRORPRINT(#ptr" == NULL\r\n");return -1;}}while(0)
#define CHECK_PTR_NULL2(ptr) do{if ((ptr) == NULL) {ERRORPRINT(#ptr" == NULL\r\n");return NULL;}}while(0)
#define CHECK_PTR_NULL3(ptr) do{if ((ptr) == NULL) {ERRORPRINT(#ptr" == NULL\r\n");return ;}}while(0)

#define TWO_DIMENSION_ARRAY_GET_ELEM_PTR(ptr, x, y, width) ( (ptr)+ (x) * (width)+ (y) ) 

#define LOCK_XXXX(obj) do {pthread_mutex_lock(&(obj)->mutex);}while(0)
#define UNLOCK_XXXX(obj) do {pthread_mutex_unlock(&(obj)->mutex);}while(0)